extract numbers from a string if they meet a specific condition